package com.chinasofti.map02;

import java.util.HashMap;
import java.util.Set;

public class Demo01 {
    public static void main(String[] args) {
        HashMap<Student,String> hm = new HashMap<>();
        Student s1 = new Student("林青霞",30);
        Student s2 = new Student("张曼玉",35);
        Student s3 = new Student("王祖贤",33);
        Student s4 = new Student("朱茵",36);
        Student s5 = new Student("林青霞",30);

        hm.put(s1,"西安");
        hm.put(s2,"长安");
        hm.put(s3,"北京");
        hm.put(s4,"上海");
        hm.put(s5,"台湾");

        Set<Student> keySet = hm.keySet();
        for (Student key:keySet) {
            String value = hm.get(key);
            System.out.println(key.getName()+","+key.getAge()+","+value);
        }

    }
}
